/**
 * 
 */
package com.shanglida.maintabs;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.shanglida.R;
import com.shanglida.activity.about.AboutTabsActivity;
import com.shanglida.activity.about.BindsnsActivity;
import com.shanglida.guide.WebSiteActivity;
import com.shanglida.view.HeaderLayout;
import com.shanglida.view.HeaderLayout.HeaderStyle;

/**
 * @author liu
 * @deprecated this activity is 5th of the TabHost and use it to set something
 *             of
 * @deprecated change and Data about UI & U can use this find U' profile and
 *             some msg
 * @deprecated & can use the view security exit~
 * @date 2014-03-07
 * @version 2.0
 */
public class UserSettingActivity extends TabItemActivity implements
		OnClickListener {
	private static HeaderLayout mHeaderLayout;

	private LinearLayout mabout, mbind, mclear;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_usersetting);
		initViews();
		initEvents();
	}

	/*
	 * 
	 */
	@Override
	protected void initViews() {
		mclear = (LinearLayout) findViewById(R.id.ll_clearcache);
		mbind = (LinearLayout) findViewById(R.id.sns_bindaccount);
		mabout = (LinearLayout) findViewById(R.id.setting_about);
		mHeaderLayout = (HeaderLayout) findViewById(R.id.nearby_header);
		mHeaderLayout.init(HeaderStyle.DEFAULT_TITLE);
	}

	/*
	 * 
	 */
	@Override
	protected void initEvents() {
		mclear.setOnClickListener(this);
		mabout.setOnClickListener(this);
		mbind.setOnClickListener(this);
	}

	@Override
	protected void init() {

	}

	@Override
	protected void onResume() {
		UserSettingActivity.mHeaderLayout.setDefaultTitle("设置", null);
		super.onResume();
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.setting_about:
			startActivity(AboutTabsActivity.class);
			break;
		case R.id.sns_bindaccount:
			startActivity(BindsnsActivity.class);
			break;
		case R.id.ll_clearcache:
			Intent test = new Intent();
			test.putExtra("URL", "http://www.baidu.com");
			test.setClass(this, WebSiteActivity.class);
			startActivityForResult(test, RESULT_OK);
			break;
		default:
			break;
		}
	}
}
